﻿<UserControl x:Class="NetBase.View.SqImgLayerView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="1*" />
        </Grid.ColumnDefinitions>
        <ToolBarTray Grid.Column="0" Orientation="Vertical">
            <ToolBar>
                <ToggleButton Name="isNeighbourGain" Click="isNeighbourGain_Click">NeighbourGain</ToggleButton>
                <ToggleButton Name="isClusterGain" Click="isClusterGain_Click">ClusterGain</ToggleButton>
                <ToggleButton Name="isIteratorTest" Click="isIteratorTest_Click">Iterator test</ToggleButton>
                <ToggleButton Name="isAreaView" Click="isAreaView_Click">Area View</ToggleButton>
            </ToolBar>
        </ToolBarTray>
        <Slider x:Name="Scale" Grid.Column="1" Margin="0"  SmallChange="1" ValueChanged="ScaleChanged" Background="Silver" Minimum="1" Maximum="20" TickPlacement="BottomRight" Orientation="Vertical" FlowDirection="RightToLeft"/>
        <ScrollViewer Grid.Column="2" Grid.Row="0" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
            <Canvas x:Name="LatticeCanvas" Width="50" Height="50" Background="Beige">
                <Canvas.Resources>
                    <ToolTip x:Key="RectToolTip">
                        <Grid Margin="5">
                            <StackPanel Orientation="Vertical" Margin="3">
                                <StackPanel Orientation="Horizontal" Margin="2">
                                    <TextBlock Text="NCG1" Margin="2"></TextBlock>
                                    <TextBlock Text="{Binding Path=NCG1}" Margin="2"/>
                                </StackPanel>
                                <StackPanel Orientation="Horizontal" Margin="2">
                                    <TextBlock Text="NCG2" Margin="2"></TextBlock>
                                    <TextBlock Text="{Binding Path=NCG2}" Margin="2"/>
                                </StackPanel>
                                <StackPanel Orientation="Horizontal" Margin="2">
                                    <TextBlock Text="NeighbourColorGain" Margin="2"></TextBlock>
                                    <TextBlock Text="{Binding Path=NeighbourColorGain}" Margin="2"/>
                                </StackPanel>
                                <StackPanel Orientation="Horizontal" Margin="2">
                                    <TextBlock Text="NeighbourColorGain2" Margin="2"></TextBlock>
                                    <TextBlock Text="{Binding Path=NeighbourColorGain2}" Margin="2"/>
                                </StackPanel>                                
                            </StackPanel>
                        </Grid>
                    </ToolTip>
                    <Style TargetType="{x:Type Rectangle}">
                        <Setter Property="ToolTip" Value="{StaticResource RectToolTip}" />
                    </Style>
                </Canvas.Resources>
                <Canvas.LayoutTransform>
                    <ScaleTransform
            CenterX="0" CenterY="0"
            ScaleX="{Binding ElementName=Scale,Path=Value}"
            ScaleY="{Binding ElementName=Scale,Path=Value}"/>
                </Canvas.LayoutTransform>
            </Canvas>
        </ScrollViewer>
    </Grid>
</UserControl>
